<html>
	<head>
		<title>Report Penerimaan Jurusan</title>
		<style>
			#list_penerimaan_kasir{
				font-size: 10px;
			}
			thead{
				background-color: black;
				color: white;
			}

		</style>
	</head>
	<body>
	<center><h1>Laporan Biaya</h1>
		<br/>
		<img src="./media/images/logo2.png"/>
		<br/>
		Periode : <?php echo $tgl_awal ?> s/d <?php echo $tgl_akhir ?>
		<br/>
		COA : <?php echo $coa ?>
	</center>
	<br/><br/>
	<table id="list_laporan_biaya" width="100%" align="center" border="0">
		<thead>
			<tr>
				<th>No</th>
				<th>Tanggal Pembayaran</th>
				<th>No. SPJ</th>
				<th>No. Polisi</th>
				<th>Sopir</th>
				<th>Jurusan</th>
				<?php if ($jenis_biaya != 'SEMUA') { ?>
					<th>Jenis Biaya</th>
				<?php } ?>
				<th>Jumlah</th>
				<th>Cabang</th>
				<th>Kasir</th>
			</tr>
		</thead>
		<tbody>
			<?php
			$sum['jenis_biaya'] = '';
			for ($i = 0; $i < count($list_result); $i++) {
				?>
				<tr>
					<td><?php echo ($i + 1) ?></td>
					<td><?php echo $setoran[$i]['tgl_pembayaran'] ?></td>
					<td><?php echo $list_result[$i]['NoSPJ'] ?></td>
					<td><?php echo $setoran[$i]['NoPol'] ?></td>
					<td><?php echo $setoran[$i]['driver'] ?></td>
					<td><?php echo $setoran[$i]['asal'] . "-" . $setoran[$i]['tujuan'] ?></td>

					<?php if ($jenis_biaya != 'SEMUA') { ?>
						<td><?php echo $setoran[$i]['nama_coa'] ?></td>
					<?php } ?>

					<td><?php $sum['jenis_biaya'] +=$list_result[$i]['jumlah'];
				echo $list_result[$i]['jumlah'] ?></td>
					<td><?php echo $list_result[$i]['cabang'] ?></td>
					<td><?php echo $setoran[$i]['nama'] ?></td>
				</tr>
			<?php } ?>
		</tbody>
	</table>
	<table>
		<tr>
			<td>Biaya Awal :</td>
			<td>Rp 
				<?php
				if (!empty($sum_asal['jumlah'])) {
					echo number_format($sum_asal['jumlah'], 0, '.', ',');
				} else {
					echo number_format(0, 0, '.', ',');
				}
				?>
			</td>
		</tr>
		<tr>
			<td>Biaya Langsung :</td>
			<td>Rp 
				<?php
				if (!empty($sum_tujuan['jumlah'])) {
					echo number_format($sum_tujuan['jumlah'], 0, '.', ',');
				} else {
					echo number_format(0, 0, '.', ',');
				}
				?>
			</td>
		</tr>

		<?php if ($jenis_biaya != 'SEMUA' && !empty($setoran[0])) { ?>
			<tr>
				<td><?php echo $setoran[0]['nama_coa'] ?> :</td>
				<td><?php echo $sum['jenis_biaya'] ?></td>
			</tr>
		<?php } ?>

	</table>
</body>
</html>